<template>
    <div>
        <el-page-header @back="goBack" title="返回" content="基础文件"></el-page-header>
        <el-form ref="form" :model="form" label-width="80px">
            {{form}}
             <el-form-item label="ID">
                <el-input v-model="form.id"></el-input>
            </el-form-item>
            <el-form-item label="文件名">
                <el-input v-model="form.fileName"></el-input>
            </el-form-item>
            <el-form-item label="后缀名">
                <el-input v-model="form.extName"></el-input>
            </el-form-item>
             <el-form-item label="文件夹">
                <el-input v-model="form.groupName"></el-input>
            </el-form-item>
            <el-form-item label="文件大小">
                <el-input v-model="form.fileSize"></el-input>
            </el-form-item>
            <el-form-item label="文件类型">
                <el-input v-model="form.fileType"></el-input>
            </el-form-item>
            <el-form-item label="更新时间">
                <el-input v-model="form.uploadTime"></el-input>
            </el-form-item>
        </el-form>
        <div style="text-align:right">
            <el-row>
                <el-button type="primary" plain @click="saveOrUpdate">主要按钮</el-button>
            </el-row>
        </div>
        
    </div>
</template>

<script>

import {get,post,del} from "@/utils/request"
export default {
    data () {
        return {
            form:{}
        }
    },
    methods: {

        // 增加数据
        saveOrUpdate(){
            // 定义一个变量存储url
            let url="http://localhost:8888/basefile/saveOrUpdate"
            // 把数据传给后代接口
            post(url,this.form).then(resp=>{
                console.log(resp);
            })
            this.$router.go(-1);
        },

        // 点击返回返回上一个页面
        goBack(){
            // 返回上一个页面 
            this.$router.go(-1);
        }
    },
    created () {
        this.form=this.$route.query;
    }
}
</script>

<style lang="sass" scoped>

</style>


